//
//  UpdateMoudle.m
//  MLSProject
//
//  Created by MinLison on 2017/10/12.
//  Copyright © 2017年 niuwaketang. All rights reserved.
//
#define MLS_USE_HARPY_UPDATE 1

#import "NYUpdateMoudle.h"
#import "MainService.h"
#import <Harpy/Harpy.h>

@interface NYUpdateMoudle () <HarpyDelegate>
@end

@implementation NYUpdateMoudle
- (void)modSetUp:(BHContext *)context
{
        id <MainServiceProtocol> handler = [[BeeHive shareInstance] createService:@protocol(MainServiceProtocol)];
        UIViewController *vc = [handler getController];
        [[Harpy sharedInstance] setPresentingViewController:vc];
        [[Harpy sharedInstance] setDelegate:self];
        [[Harpy sharedInstance] setShowAlertAfterCurrentVersionHasBeenReleasedForDays:1];
        [[Harpy sharedInstance] setAlertType:HarpyAlertTypeForce];
        [[Harpy sharedInstance] setMajorUpdateAlertType:HarpyAlertTypeForce];
        [[Harpy sharedInstance] setMinorUpdateAlertType:HarpyAlertTypeForce];
        [[Harpy sharedInstance] setPatchUpdateAlertType:HarpyAlertTypeForce];
        [[Harpy sharedInstance] setRevisionUpdateAlertType:HarpyAlertTypeForce];
        [[Harpy sharedInstance] checkVersion];
}

- (void)modDidBecomeActive:(BHContext *)context
{
        [[Harpy sharedInstance] checkVersion];
}
@end
